home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Samples / SampleCode / Tumbler and Podium / Tumbler_AEVT.h < prev    next >
Encoding:
Text File  |  1995-05-31  |  2.2 KB  |  84 lines  |  [TEXT/MPS ]

  1. //    Tumbler_AEVT.c
  2. //
  3. //    Apple Event Routines for the Tumbler App.  Contains AppleEvent Handlers and senders for
  4. //  the Tumbler app.
  5. //        
  6. //    Author:        Nick Thompson, 11/24/94
  7. //
  8. //    Modification History:
  9. //
  10. //    11/26/94        nick        added output from symantec proto_helper app
  11. //    11/24/94        nick        Initial Cut - factored code from Tumbler event, added
  12. //                                 Drag related events for debugging (you can't debug the 
  13. //                                handler, but if the handler sends an event you can debug
  14. //                                the AE handler).
  15. //
  16. //    Copyright © 1992-95 Apple Computer, Inc.
  17. //
  18.  
  19. #ifndef _Tumbler_AEVT_H_
  20. #define _Tumbler_AEVT_H_
  21.  
  22. // resource types for the appleevent error handlers
  23. enum {
  24.     rUserAlert = 1001,
  25.     rFatalAlert
  26. } ;
  27.  
  28. //-----------------------------------------------------------------------
  29. // 'STR#' resource ID items
  30.  
  31. enum {
  32.     rErrorStringIndex = 1000,
  33.     rFatalErrorStringIndex
  34. } ;
  35.  
  36. typedef struct _myPrivateData {
  37.     OSType            myTypeOfData ;
  38.     long            myDataSize ;
  39.     DocumentPtr myDocument ;        // ideally we should store the doc in the window's refcon, this is hacky ???
  40.     WindowPtr        myWindow ;
  41.     Point            myLocation ;
  42.     unsigned char    myData[] ;
  43. } myPrivateDataRec, *myPrivateDataPtr, **myPrivateDataHdl ;
  44.  
  45.  
  46.  
  47. // fatal error codes
  48. enum {
  49.     eFatalNeedsAEVTMgr = 1        // This application needs AppleEvents to run
  50. } ;
  51.  
  52. void             FailIfErr (OSErr  error) ;
  53. void             AlertUser (short  error) ;
  54. void             FatalError(short error) ;
  55.  
  56. void             InitAEStuff( void ) ; 
  57. Boolean         SupportsAEVT(void) ;
  58.  
  59. void             DoHighLevelEvent(EventRecord *ev) ;
  60.  
  61. void             RegisterMyEvents(void) ;
  62.  
  63. // core event handlers
  64. pascal OSErr    MyAEHandleOAPP(AppleEvent *theAppleEvent,AppleEvent *reply,long refCon) ;
  65. pascal OSErr     MyAEHandleODOC(AppleEvent *theAppleEvent,AppleEvent *reply,long refCon) ;
  66. pascal OSErr     MyAEHandlePDOC(AppleEvent *theAppleEvent,AppleEvent *reply,long refCon) ;
  67. pascal OSErr     MyAEHandleQUIT(AppleEvent *theAppleEvent,AppleEvent *reply,long refCon) ;
  68.  
  69. // my "special" event handler(s)
  70. pascal OSErr     MyAEHandleDragRecv(AppleEvent *theAppleEvent,AppleEvent *reply,long refCon) ;
  71.  
  72. // AEVT SENDERS
  73.  
  74. // send core events
  75. void SendQuitApp( void ) ;
  76. void SendOpenDoc(FSSpec *myFSSpec) ;
  77. void SendPrintDoc(FSSpec *myFSSpec) ;
  78.  
  79. // send stuff for the drag receive handlers
  80. void SendDragRecv( myPrivateDataHdl privateHdl ) ;
  81.  
  82. #endif
  83.  
  84.